
<table id=table class="adminlist">
	<thead>
		<tr>
			<th style='text-align:center;'>#</th>

			<th id='id' class='{$data.sort_ID}' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">NPT</a></th>
			
			<th id='nama'  class='{$data.sort_nama}' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">Nama </a></th>

			<th id='jurusan' class='{$data.sort_jurusan}' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">Jurusan</a></th>
		  
			<th id='lulus' class='{$data.sort_lulus}' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">Lulus</a></th>
			
			<th id='angkatan' class='{$data.sort_angkatan}' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">Angkatan</a></th>
		</tr>
	</thead>
	
	<tbody>
	{if $data.rows}
		{foreach name=data  from=$data.rows item=i}	
			{$css   =  ($smarty.foreach.data.iteration % 2 == 0) ? "'row0'": "'row1'"}
			
			<tr class={$css}>
				<td class='tc'><span class="tag tag-gray">{$smarty.foreach.data.iteration + $data.offset}</span></td>
 				<td class='tc'>{$i.id}</td>
				
				<td class='edit'>
					<a href='{$site.site}admin/alumniForm/{$i.id}/{$data.order}/{$data.sort}/{$data.paging.c}/{$data.limit}'>
					{$i.nama}
					</a>
				</td>

				<td class='center'>
					{$i.jurusan}
				</td>
				
				<td class='center'>
					{$i.lulus}
				</td>				
				
				<td class='center'>
					{$i.angkatan}
				</td>
			</tr>
		{/foreach}
	{/if}
	</tbody>
	
	<tfoot>
	<tr>
		<td colspan="13">
		<del class="container">
			<div class="pagination"><div class="paging">
			
				{if count($data.paging) > 0}
				<a class='first' href='{$site.site}admin/alumni/{$data.order}/{$data.sort}/1/{$data.limit}'></a>
				<a class='prev'  href='{$site.site}admin/alumni/{$data.order}/{$data.sort}/{$data.paging.p}/{$data.limit}'></a>     
				<span>Page {$data.paging.c} of {$data.paging.l} </span>
				<a class='next'  href='{$site.site}admin/alumni/{$data.order}/{$data.sort}/{$data.paging.n}/{$data.limit}'></a>
				<a class='last'  href='{$site.site}admin/alumni/{$data.order}/{$data.sort}/{$data.paging.l}/{$data.limit}'></a>
				{/if}
			</div></div>
		</del>
		</td>
	</tr>
	</tfoot>

</table>


<script id="category-script" type="text/javascript">
$(document).ready(function(){

	$("#table thead th").each(
	   function(){
		  $( this ).bind (
			 "click",
			 function(){
				var id   =  $(this).attr('id') ;
				var sort =  $(this).attr('class');
				
				$('#table').load('{$site.site}adminajax/pengajarSorting/' + id + '/' + sort + '/' + {$data.page} + '/' + {$data.limit});
			 }
		  );
	   }
	);   

	$('.publish a').click( function (e) {
		var id = $(this).attr('id');
		var publish = $(this).attr('class');

		var _post = [{ name:'id', value:id }]
		_post.push({ name:'publish', value:publish });
		
		$.post('{$site.site}adminajax/pengajarPublishing/', _post, function(response) {
			//alert(id + '=' + response + '=' + publish);
			
			if (response=="0"){
				$(this).attr('class', '1');
				$('#img_' + id).attr('src', '{$site.assets}css/img/led-ico/unpublish.png');
			} else if (response=="1"){
				$(this).attr('class','0');
				$('#img_' + id).attr('src', '{$site.assets}css/img/led-ico/publish.png');
			} else {
				alert(response);
			}
		});
	});
});
</script>